#include <master.h>

void panic(char * why) {
   printf("\n\nPanic: %s\n", why);
   dprint("\n\n*** Kernel panic: %s\n", why);
   _hlt();
}

void
reboot ()
{
  dprint ("Kernel halted: System reboot.\n");
  printf ("Rebooting.\n");

  disable_irqs ();		// Disable Interrupts
  while ((inportb (0x64) & 0x02) != 0);	// Clear keyboard buffer
  outportb (0x64, 0xFE);	// Signal the reset to CPU

  // We should'nt get here but if we do halt the CPU
  panic ("Cannot reboot machine. Please press the reset button.");
}
